setTimeout(() => {
    console.log('s1')
    Promise.resolve().then(() => {
        console.log('p1')
    })
    process.nextTick(() => {
        console.log('nt1')
    })
})

setTimeout(() => {
    console.log('s2')
    Promise.resolve().then(() => {
        console.log('p2')
    })
    process.nextTick(() => {
        console.log('nt2')
    })
})

setImmediate(() => {
    console.log('st')
})